package cobersky.skinUI.core
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	public class Application extends Sprite
	{
		public function Application()
		{
			stage?setStage():addEventListener(Event.ADDED_TO_STAGE,setStage);
		}
		private function setStage(e:Event=null):void{
			if(e)removeEventListener(Event.ADDED_TO_STAGE,setStage);
			stage.scaleMode=StageScaleMode.NO_SCALE;
			stage.showDefaultContextMenu=false;
			stage.align=StageAlign.TOP_LEFT;
			stage.addEventListener(Event.RESIZE,onResize);
		}
		protected function onResize(event:Event):void
		{
			
		}
		public function addElement(c:Component):void{
			c.create();
			this.addChild(c);
		}
		public function removeElement(c:Component):void{
			this.removeChild(c);
		}
	}
}